package com.jlkf.service.impl;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jlkf.common.ExportExcel;
import com.jlkf.common.redis.service.JedisClient;
import com.jlkf.dao.CarCaculationMapper;
import com.jlkf.dao.OrderChargeDetailMapper;
import com.jlkf.dao.OrderItemsMapper;
import com.jlkf.dao.PinpayRecordMapper;
import com.jlkf.dao.StarRemarkMapper;
import com.jlkf.dao.UserBrankMapper;
import com.jlkf.dao.UserMapper;
import com.jlkf.pojo.CarCaculation;
import com.jlkf.pojo.OrderItems;
import com.jlkf.pojo.PinpayRecord;
import com.jlkf.pojo.StarRemark;
import com.jlkf.pojo.User;
import com.jlkf.pojo.UserBrank;
import com.jlkf.service.OrderItemsService;
import com.jlkf.view.OAMonthlyIncomeOfDrivers;
import com.jlkf.view.WeekNoSettlement;
import com.jlkf.view.OA.CompleteOAOrderItems;
import com.jlkf.view.OA.OANoSettlementDetail;
import com.jlkf.view.OA.OAOrderItems;
import com.jlkf.view.OA.OAOrderItemsExport;
import com.platform.server.response.response.pojo.ReturnData;
import com.platform.server.util.DateUtil;
import com.platform.server.util.RegexUtil;
import com.platform.server.util.StringTools;

import io.practiceinsight.pinpayments.pojo.ErrorMessage;
import io.practiceinsight.pinpayments.pojo.ErrorResponse400;
import io.practiceinsight.pinpayments.pojo.ErrorResponseCard;
import io.practiceinsight.pinpayments.pojo.ResponseCharges;
import io.practiceinsight.pinpayments.utils.PinPayHttpUtils;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

@Service
public class OrderItemsServiceImpl implements OrderItemsService{

	@Autowired
	private OrderItemsMapper orderItemsMapper;
	@Autowired
	private UserMapper userMapper;
	@Autowired
	private OrderChargeDetailMapper orderChargeDetailMapper;
	@Autowired
	private JedisClient jedisClient;
	@Autowired
	private CarCaculationMapper carCaculationMapper;
	@Autowired
	private UserBrankMapper userBrankMapper;
	@Autowired
	private PinpayRecordMapper pinpayRecordMapper;
	@Autowired
	private JedisPool jedisPool; 
	@Autowired
	private StarRemarkMapper starRemarkMapper;
	
	@Override
	public Object getUnfinishedList(String orderNo, String createTime, Integer status, Integer carType,
			String licensePlate, String telephone, String driverName, String driverPhone, Integer pageNo,
			Integer pageSize,Integer queryType,Integer refundsPrice) {
		Map<String,Object> map = new HashMap<>();
		if(!StringTools.isEmpty(orderNo)){
			map.put("orderNo", orderNo);
		}
		if(!StringTools.isEmpty(createTime)){
			 String[] createTime1= createTime.split("/");
			map.put("createTime", createTime1[2]+"-"+createTime1[1]+"-"+createTime1[0]);
		}
		if(!StringTools.isEmpty(licensePlate)){
			map.put("licensePlate", licensePlate);
		}
		if(!StringTools.isEmpty(telephone)){
			map.put("telephone", telephone);
		}
		if(!StringTools.isEmpty(driverName)){
			map.put("driverName", driverName);
		}
		if(!StringTools.isEmpty(driverPhone)){
			map.put("driverPhone", driverPhone);
		}
		if(!RegexUtil.isNull(carType)){
			map.put("carType", carType);
		}
		if(!RegexUtil.isNull(status)){
			map.put("status", status);
		}
		if(!RegexUtil.isNull(refundsPrice)){
			map.put("refundsPrice", refundsPrice);
		}
		map.put("queryType", queryType);
		try {
			PageHelper.startPage(pageNo, pageSize);
			List<OAOrderItems> list = orderItemsMapper.getOAOrder(map);
			if(queryType==2){
				for(OAOrderItems oai:list){
					Map<String,Object> map1 = new HashMap<>();
					map1.put("type", 2);
					map1.put("orderId", oai.getId());
					List<StarRemark> lists=starRemarkMapper.getStarRemarkList1(map1);
					if(lists.size()>0){
						oai.setStar(lists.get(0).getStar()+"");
						oai.setContent(lists.get(0).getContent());
					}
				}
			}
			PageInfo<OAOrderItems> info = new PageInfo<>(list);
			return new ReturnData(list,(int)info.getPages(),(int)info.getTotal(),200,"success");
		} catch (Exception e) {
			e.printStackTrace();
			return new ReturnData(500,"Wow, that's wrong");
		}
	}


	@Override
	public void getUnfinishedExport(String orderNo, String createTime, Integer status, Integer carType,
			String licensePlate, String telephone, String driverName, String driverPhone, Integer queryType,
			HttpServletResponse response, HttpServletRequest request) {
		Map<String,Object> map = new HashMap<>();
		if(!StringTools.isEmpty(orderNo)){
			map.put("orderNo", orderNo);
		}
		if(!StringTools.isEmpty(createTime)){
			map.put("createTime", createTime);
		}
		if(!StringTools.isEmpty(licensePlate)){
			map.put("licensePlate", licensePlate);
		}
		if(!StringTools.isEmpty(telephone)){
			map.put("telephone", telephone);
		}
		if(!StringTools.isEmpty(driverName)){
			map.put("driverName", driverName);
		}
		if(!StringTools.isEmpty(driverPhone)){
			map.put("driverPhone", driverPhone);
		}
		if(!RegexUtil.isNull(carType)){
			map.put("carType", carType);
		}
		if(!RegexUtil.isNull(status)){
			map.put("status", status);
		}
		map.put("queryType", queryType);
		try {
			List<OAOrderItems> list = orderItemsMapper.getOAOrder(map);
			List<Object> list1 = new ArrayList<>();
			 for(OAOrderItems oi:list){
				 OAOrderItemsExport oao = new OAOrderItemsExport();
				 oao.setArrivedLocation(oi.getArrivedLocation());
				 oao.setCarNum(oi.getCarNum());
				 oao.setCarType(carType(oi.getCarType()));
				 oao.setCreateTime(DateUtil.format(oi.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
				 oao.setDepartureLocation(oi.getDepartureLocation());
				 oao.setDriverName(oi.getDriverName());
				 oao.setDriverPhone(oi.getDriverPhone());
				 oao.setName(oi.getName());
				 oao.setOrderNo(oi.getOrderNo());
				 oao.setStatus(status(oi.getStatus()));
				 oao.setTelephone(oi.getTelephone());
				 oao.setVehicleRand(oi.getVehicleRand());
				 oao.setWayToPlace(oi.getWayToPlace());
				 list1.add(oao);
			 }
			 String[] Title = {"Order number","Created at", "Order status", "Pick up address", "Extra stop", "Destination address", "Distance (KM)", "Service category","Drivers name","Total paid","Refund","Reviews","Tips"};
			    ExportExcel.exportExcel("Incomplete orders.xls", Title, list1, response);
		} catch (Exception e) {
			// TODO: handle exception
		}
		
	}
	
	private String status(Integer status){
		 String result="";
		 switch (status) {
		case 1:
			result="Waiting for order";
			break;
		case 2:
			result="Order confirmed ( Driver Confirmed)  ";
			break;
		case 3:
			result="On Route to pick up point";
			break;
		case 4:
			result="Arrived at pick up point";
			break;
		case 5:
			result="Rider on board";
			break;
		case 7:
			result="Order completed";
			break;
		}
		 return result;
	 }
 private String carType(Integer carType){
	 String result="";
	 switch (carType) {
	case 1:
		result="fab ONE";
		break;
	case 2:
		result="fab";
		break;
	case 3:
		result="fab PRO";
		break;
	}
	 return result;
 }


@Override
public void getCompleteExport(String orderNo, String createTime, Integer status, Integer carType, String licensePlate,
		String telephone, String driverName, String driverPhone, Integer queryType, HttpServletResponse response,
		HttpServletRequest request, Integer refundsPrice) {
	Map<String,Object> map = new HashMap<>();
	if(!StringTools.isEmpty(orderNo)){
		map.put("orderNo", orderNo);
	}
	if(!StringTools.isEmpty(createTime)){
		map.put("createTime", createTime);
	}
	if(!StringTools.isEmpty(licensePlate)){
		map.put("licensePlate", licensePlate);
	}
	if(!StringTools.isEmpty(telephone)){
		map.put("telephone", telephone);
	}
	if(!StringTools.isEmpty(driverName)){
		map.put("driverName", driverName);
	}
	if(!StringTools.isEmpty(driverPhone)){
		map.put("driverPhone", driverPhone);
	}
	if(!RegexUtil.isNull(carType)){
		map.put("carType", carType);
	}
	if(!RegexUtil.isNull(status)){
		map.put("status", status);
	}
	if(!RegexUtil.isNull(refundsPrice)){
		map.put("refundsPrice", refundsPrice);
	}
	map.put("queryType", queryType);
	try {
		List<OAOrderItems> list = orderItemsMapper.getOAOrder(map);
		List<Object> list1 = new ArrayList<>();
		 for(OAOrderItems oi:list){
			 CompleteOAOrderItems oao = new CompleteOAOrderItems();
			 oao.setArrivedLocation(oi.getArrivedLocation());
			 oao.setCarNum(oi.getCarNum());
			 oao.setCarType(carType(oi.getCarType()));
			 oao.setCreateTime(DateUtil.format(oi.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
			 oao.setDepartureLocation(oi.getDepartureLocation());
			 oao.setDriverName(oi.getDriverName());
			 oao.setDriverPhone(oi.getDriverPhone());
			 oao.setName(oi.getName());
			 oao.setOrderNo(oi.getOrderNo());
			 oao.setStatus(status(oi.getStatus()));
			 oao.setTelephone(oi.getTelephone());
			 oao.setVehicleRand(oi.getVehicleRand());
			 oao.setWayToPlace(oi.getWayToPlace());
			 oao.setTotalPrice(oi.getTotalPrice().doubleValue());
			 oao.setExceptionalATip(oi.getExceptionalATip());
			 oao.setRefundsPrice(oi.getRefundsPrice());
			 oao.setStar(oi.getStar());
			 list1.add(oao);
		 }
		 String[] Title = {"Order number","Created at", "Order status", "Pick up address", "Extra stop", "Destination address", "Distance (KM)", "Service category","Drivers name","Total paid","Refund","Reviews","Tips","Completed orders","退款金额","评论星级","打赏金额"};
		    ExportExcel.exportExcel("Completed orders.xls", Title, list1, response);
	} catch (Exception e) {
		// TODO: handle exception
	}
	
}



	@Override
	public Object getNoSettlement(String driverName, String driverPhone, Integer pageNo, Integer pageSize) {
		Map<String,Object> map = new HashMap<>();
		map.put("identity", 2);
		if(!StringTools.isEmpty(driverName)){
			map.put("firstName", driverName);
		}
		if(!StringTools.isEmpty(driverPhone)){
			map.put("telephone", driverPhone);
		}
		Jedis jedis=null;
		if(jedis==null){
			jedis = jedisPool.getResource();
		}
		try {
			PageHelper.startPage(pageNo, pageSize);
			List<User> listUser=userMapper.getNameAndTel(map);
			List<CarCaculation> ccmlist1 =new ArrayList<>();
			List<CarCaculation> ccmlist =new ArrayList<>(); // 计价规则
			List<WeekNoSettlement> wnsList =new ArrayList<>();
			DecimalFormat df = new DecimalFormat("######0.00");
			 Date d = new Date();
			 map.put("startTime",DateUtil.getMonthBegin(DateUtil.format(d, "yyyy-MM-dd")));//结算时间开始时间
 			 map.put("endTime",DateUtil.getMonthEnd(DateUtil.format(d, "yyyy-MM-dd")));//结算时间 结束时间
 			 map.put("status", 1);
			for(User u:listUser){
				map.put("driverId", u.getId());
			/*	for(int i=1;i<4;i++){
					String carcresult=jedis.get("carCaculation_carType"+i);
					if(StringTools.isEmpty(carcresult)){
						map.put("carType", i);
						ccmlist1 = carCaculationMapper.getCarCaculation(map);// 计价规则
						JSONArray ja = JSONArray.fromObject(ccmlist1);
						String jlist=ja.toString();
						jedis.set("carCaculation_carType"+i, jlist);
						if(ccmlist1.size()>0){
							ccmlist.add(ccmlist1.get(0));
						}
					}else{
						ccmlist1 = JSONArray.toList(JSONArray.fromObject(carcresult),CarCaculation.class);
						if(ccmlist1.size()>0){
							CarCaculation c=ccmlist1.get(0);
							ccmlist.add(c);
						}
					}
			}*/
				Double platform=0.0;double totalBusinesss=0.0;double totalRevenue=0.0;double tolls=0.0;double upto=0.0;double tip=0.0;
				/*for(CarCaculation c:ccmlist){
					map.put("carType", c.getCarType());
					WeekNoSettlement wns=orderChargeDetailMapper.getOANoSettlement(map);
					platform+=Double.parseDouble(wns.getTotalBusiness())*c.getFabCommission();
					 totalBusinesss+=Double.parseDouble(wns.getTotalBusiness());
					 totalRevenue+=Double.parseDouble(wns.getTotalRevenue());
					 tolls+=Double.parseDouble(wns.getTolls());
					 upto+=Double.parseDouble(wns.getUpto());
					 tip+=Double.parseDouble(wns.getTip());
	                map.remove("carType");
	               
				}*/
				OAMonthlyIncomeOfDrivers omid=orderChargeDetailMapper.monthlyStatistics(map);
				WeekNoSettlement wns1=addWeekNoSettlement(omid, u);
					 wnsList.add(wns1);
			}
			PageInfo<User> info = new PageInfo<>(listUser);
			return new ReturnData(wnsList,(int)info.getPages(),(int)info.getTotal(),200,"success");
		} catch (Exception e) {
			e.printStackTrace();
			return new ReturnData(500,"Wow, that's wrong");
		}finally {
			 if(jedis!=null){
				 jedis.close();
			 }
		}
	}
	private WeekNoSettlement addWeekNoSettlement(OAMonthlyIncomeOfDrivers omid,User u){
		WeekNoSettlement wns1=new WeekNoSettlement();
		 if(omid!=null){
			 wns1.setPlatform(omid.getFab().toString());
			 wns1.setTotalBusiness(omid.getTotalTurnover()+"");
			 wns1.setTip(omid.getTip()+"");
			 wns1.setTolls(omid.getTolls()+"");
			 wns1.setTotalRevenue(omid.getTotalTurnover()+"");
			 wns1.setUpto(omid.getCleanness()+"");
			 wns1.setFirstName(u.getFirstName());
			 wns1.setTelephone(u.getTelephone());
			 wns1.setId(u.getId());
		 }else{
			 wns1.setPlatform("0.0");
			 wns1.setTotalBusiness("0.0");
			 wns1.setTip("0.0");
			 wns1.setTolls("0.0");
			 wns1.setTotalRevenue("0.0");
			 wns1.setUpto("0.0");
			 wns1.setFirstName(u.getFirstName());
			 wns1.setTelephone(u.getTelephone());
			 wns1.setId(u.getId());
		 }
		 return wns1;
	}
		 public static Date geLastWeekMonday(Date date) {  
	            Calendar cal = Calendar.getInstance();  
	            cal.setTime(getThisWeekMonday(date));  
	            cal.add(Calendar.DATE,0);  
	            return cal.getTime();  
	        } 
		    //给定时间  本周结束时间
		    public static Date geLendWeekMonday(Date date) {  
	            Calendar cal = Calendar.getInstance();  
	            cal.setTime(date);  
	            cal.add(Calendar.DATE, 7);  
	            return cal.getTime();  
	        } 
		    public static Date getThisWeekMonday(Date date) {  
		        Calendar cal = Calendar.getInstance();  
		        cal.setTime(date);  
		        // 获得当前日期是一个星期的第几天  
		        int day = cal.get(Calendar.DAY_OF_WEEK);  
		        // 根据日历的规则，给当前日期减去星期几与一个星期第一天的差值  
		        cal.add(Calendar.DATE, cal.getFirstDayOfWeek() - day);  
		        return cal.getTime();  
		    }

//未结算
			@Override
			public Object getNoSettlementDetail(String driverId, Integer pageNo, Integer pageSize,Integer status) {
				Map<String,Object> map = new HashMap<>();
				 Date d = new Date();
				 map.put("startTime",DateUtil.getMonthBegin(DateUtil.format(d, "yyyy-MM-dd")));//结算时间开始时间
	 			 map.put("endTime",DateUtil.getMonthEnd(DateUtil.format(d, "yyyy-MM-dd")));//结算时间 结束时间
	 			 map.put("driverId", driverId);
	 			 map.put("status", 2);
				try{
					PageHelper.startPage(pageNo, pageSize);
		 			List<OANoSettlementDetail>  list=orderChargeDetailMapper.getOANoSettlementDetail(map);
					PageInfo<OANoSettlementDetail> info = new PageInfo<>(list);
					return new ReturnData(list,(int)info.getPages(),(int)info.getTotal(),200,"success");
				}catch (Exception e){
					e.printStackTrace();
					return new ReturnData(500,"Wow, that's wrong");
				  }
			}


			@Override
			public Object buckleTravelFee(String json) {
				OrderItems oi1 = StringTools.json2Obj(json, OrderItems.class);
				if(oi1==null){
					return new ReturnData(201,"List must be filled！");
				}
				try {
					OrderItems oi=orderItemsMapper.selectByPrimaryKey(oi1.getId());//查询订单
					User u = userMapper.selectByPrimaryKey(oi.getuId());//查询用户  记录 统计用户的消费金额 与里程
					UserBrank ub = userBrankMapper.selectByPrimaryKey(oi.getUbId());//冻结预估价的卡
					String yearAndMon=ub.getExpirationTime();
					String[] ym=yearAndMon.split("/");
					//////支付 扣钱/////////////
					Map<String, String> sendMap=new HashMap<>();
			    	Integer tos=(int) (oi.getTotalPrice().doubleValue()*100);//扣款金额
			    	sendMap.put("amount", tos+"");//需要支付的金额
			    	sendMap.put("currency", "AUD");
			    	sendMap.put("description", oi.getOrderNo());
			    	sendMap.put("email", u.getEmail());
			    	sendMap.put("ip_address", oi.getCustomer_ip());
			    	sendMap.put("card[number]", ub.getUbBrankNo());
			    	sendMap.put("card[expiry_month]", ym[0]);
			    	sendMap.put("card[expiry_year]", ym[1]);
			    	sendMap.put("card[cvc]", ub.getAfterThree());
			    	sendMap.put("card[name]", ub.getTheCardholder());
//			    	sendMap.put("card[address_line1]", ub.getAddressLine1());
//			      	sendMap.put("card[address_city]", ub.getAddressCity());
			    	sendMap.put("card[address_country]", "Australia");//澳大利亚
					String jrc=null;
					Map<String,Object> resut=PinPayHttpUtils.sendPinPayChargesPost(sendMap);//支付
			    	  if(resut.get("code")!=null&&(int)resut.get("code")==201){//支付成功
			    		  ResponseCharges rc=(ResponseCharges) resut.get("obj");
			    		   jrc = JSONObject.fromObject(rc).toString();
			   		}else if(resut.get("code")!=null&&(int)resut.get("code")==422){
			   			ErrorResponseCard rc=(ErrorResponseCard) resut.get("obj");
			   			String error="";
			   			if(rc!=null){
			   				List<ErrorMessage> liMessage=JSONArray.toList(JSONArray.fromObject(rc.getMessages()), ErrorMessage.class);
			                for(ErrorMessage ee:liMessage){
			              	  error+=ee.getMessage()+" ; "; 
			                }
			   			}
			   			jrc =  JSONObject.fromObject(rc).toString();
			   			return new ReturnData(900,error);
			   		}else if(resut.get("code")!=null&&(int)resut.get("code")==400){
			   			ErrorResponse400 rc=(ErrorResponse400) resut.get("obj");
			   			jrc = JSONObject.fromObject(rc).toString();
			   			return new ReturnData(300,rc.getError_description());
					}
			      PinpayRecord ppr = new PinpayRecord(oi.getId(),jrc,(int)resut.get("code"),new Date(),1);//支付记录
		  		  pinpayRecordMapper.insertSelective(ppr);//保存交易记录
		  		  if((int)resut.get("code")==201){
		  			oi.setStatus(8);
		  			orderItemsMapper.selectByPrimaryKey(oi1.getId());//查询订单
		  			  return new ReturnData(200,"success");
		  		  }
		  		 return new ReturnData(202,"fail");
				} catch (Exception e) {
					e.printStackTrace();
					return new ReturnData(500,"Wow, that's wrong");
				}
	  		  
			}


		/*	@Override
			public void getNoSettlementExport(String driverName, String driverPhone, HttpServletResponse response,
					HttpServletRequest request) {
				Map<String,Object> map = new HashMap<>();
				map.put("identity", 2);
				if(!StringTools.isEmpty(driverName)){
					map.put("firstName", driverName);
				}
				if(!StringTools.isEmpty(driverPhone)){
					map.put("telephone", driverPhone);
				}
				try {
					List<User> listUser=userMapper.getNameAndTel(map);
					List<CarCaculation> ccmlist1 =new ArrayList<>();
					List<CarCaculation> ccmlist =new ArrayList<>(); // 计价规则
					List<WeekNoSettlement> wnsList =new ArrayList<>();
					DecimalFormat df = new DecimalFormat("######0.00");
					 Date d = new Date();
					 map.put("startTime",DateUtil.format( geLastWeekMonday(d), "yyyy-MM-dd"));//结算时间开始时间
		 			 map.put("endTime",DateUtil.format(  geLendWeekMonday(geLastWeekMonday(d)), "yyyy-MM-dd"));//结算时间 结束时间
		 			List<Object> list1 = new ArrayList<>();
					for(User u:listUser){
						map.put("driverId", u.getId());
						for(int i=1;i<4;i++){
							String carcresult=jedisClient.get("carCaculation_carType"+i);
							if(StringTools.isEmpty(carcresult)){
								map.put("carType", i);
								ccmlist1 = carCaculationMapper.getCarCaculation(map);// 计价规则
								JSONArray ja = JSONArray.fromObject(ccmlist1);
								String jlist=ja.toString();
								jedisClient.set("carCaculation_carType"+i, jlist);
								if(ccmlist1.size()>0){
									ccmlist.add(ccmlist1.get(0));
								}
							}else{
								ccmlist1 = JSONArray.toList(JSONArray.fromObject(carcresult),CarCaculation.class);
								if(ccmlist1.size()>0){
									CarCaculation c=ccmlist1.get(0);
									ccmlist.add(c);
								}
							}
					}
						
						Double platform=0.0;double totalBusinesss=0.0;double totalRevenue=0.0;double tolls=0.0;double upto=0.0;double tip=0.0;
						for(CarCaculation c:ccmlist){
							map.put("carType", c.getCarType());
							WeekNoSettlement wns=orderChargeDetailMapper.getOANoSettlement(map);
							platform+=Double.parseDouble(wns.getTotalBusiness())*c.getFabCommission();
							 totalBusinesss+=Double.parseDouble(wns.getTotalBusiness());
							 totalRevenue+=Double.parseDouble(wns.getTotalRevenue());
							 tolls+=Double.parseDouble(wns.getTolls());
							 upto+=Double.parseDouble(wns.getUpto());
							 tip+=Double.parseDouble(wns.getTip());
			                map.remove("carType");
			               
						}
						WeekNoSettlement wns1=new WeekNoSettlement();
						 wns1.setPlatform(df.format(platform).toString());
						 wns1.setTotalBusiness(totalBusinesss+"");
						 wns1.setTip(tip+"");
						 wns1.setTolls(tolls+"");
						 wns1.setTotalRevenue(totalRevenue+"");
						 wns1.setUpto(upto+"");
						 wns1.setFirstName(u.getFirstName());
						 wns1.setTelephone(u.getTelephone());
						 wns1.setId(u.getId());
						 wnsList.add(wns1);
					}
					 String[] Title = {"司机姓名","司机电话", "订单状态", "上车地址", "途经点", "下车地址", "里程（公里）", "服务类型","司机姓名","实付金额","退款金额","评论星级","打赏金额","实付金额","退款金额","评论星级","打赏金额"};
					    ExportExcel.exportExcel("已完成订单.xls", Title, list1, response);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}*/
			
		  
}
